package MagicNubser;

import java.util.Scanner;

public class MagicNubser {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Long n = scanner.nextLong();
        Long m = 142587*n;
        Long sum = fenjie(m);
        if(sum == 9) {
            System.out.println("结果为9");
        }else if(sum<9) {
            System.out.println("结果不为9");
        }
        while (sum>9) {
            //循环分解
            sum = fenjie(sum);
            if(sum == 9) {
                System.out.println("结果为9");
                break;
            }else if(sum<9) {
                System.out.println("结果不为9");
                break;
            }

        }
    }

    private static Long fenjie(Long m) {
        Long sum = 0L;
        char[] mArr  = (m+"").toCharArray();
        for (int i = 0; i < mArr.length; i++) {
            sum = sum + (mArr[i] - '0');
        }
        return sum;
    }
}
